/* -+- file  ./kf2/Events/SubscribeEvent.cs -+- */
/*
 * kf2 jabber client
 * ~~~~~~~~~~~~~~~~~
 *
 * Copyright (C) 2006-2007 Przemysław Sitek
 * 				<przemyslaw.sitek at wp.pl> 
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this program; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

using System;
using Habazie.kf2.Core;
using Habazie.kf2.Net;
using Habazie.kf2.GUI;

namespace Habazie.kf2.Events
{
	
	public class SubscribeEvent : Event
	{
		private jabber.protocol.client.Presence m_Presence;
		
		public SubscribeEvent(Account acc, jabber.protocol.client.Presence presence)
			: base (acc, presence)
		{
			m_Presence = presence;
			m_EventName = "sub";

			Util.PlaySound ("system");
		}
		
		///<summary>Display this event</summary>
		public override void Display ()
		{
			SubscribeDialog win = new SubscribeDialog (Source, m_Presence);
			win.Show ();
		}
		
		///<summary>Notify user of event</summary>
		public override void Notify (INotifyService notify)
		{
		//	notify.Notify (NotifyClass.Message, "Message from " + m_Message.From.ToString (), m_Message.Body);
		}
		
		///<summary>Get string representation of this event</summary>
		public override string ToString ()
		{
			return m_Presence.From.ToString ();
		}
		
	}
}
